package com.showde.shoppingmall.adapter;

import com.showde.shoppingmall.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MoreAdapter extends BaseAdapter {

	String[] items;
	Context context;

	public MoreAdapter(Context context, String[] items) {
		this.context = context;
		this.items = items;
	}

	@Override
	public int getCount() {
		return items.length;
	}

	@Override
	public Object getItem(int arg0) {
		return items[arg0];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(
					R.layout.item_list_more, null);
			holder = new ViewHolder();
			holder.textView = (TextView) convertView
					.findViewById(R.id.txt_itemname);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.textView.setText(items[position]);
		return convertView;
	}

	private final class ViewHolder {
		TextView textView;
	}

}
